// 日期格式化：年-月-日 时：分：秒
export const formatDate = () => {
  let date = new Date()
  let year = date.getFullYear()
  let month = date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1
  let day = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
  let hour = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
  let minutes = date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
  let second = date.getSeconds() < 10 ? '0' + date.getSeconds() : date.getSeconds()
  return year + '年' + month + '月' + day + '日' + ' ' + hour + ':' + minutes + ':' + second
}

// 日期格式化：时
export const formatHour = () => {
  let date = new Date()
  let hour = date.getHours() < 10 ? '0' + date.getHours() : date.getHours()
  return hour
}
